str = "C语言学习网"
# 索引

print(str[1],"==",str[3])
print(str[2],"==",str[4])



# 切片
str = "C语言学习网"
print(str[0:2])
print(str[-3:-1])
print(str[::2]) #每2个字符取第一个
print(str[:])

# 序列相加

str = 'c语言'
str2 = 'python语言'
t = ('a','b')
print(str+str2)
# print(str+str2+t) # 字符串和字符串连接，不能和元祖连接
t2 = ('c','d')

print(t + t2) # ('a', 'b', 'c', 'd')

# 序列相乘

str = 'a组'
print(str*3)

str = 'abcdef'
print('a' in str)
